ETH1 LWIP Echo Server Test

Create Vivado Project

Modify the hardware based on the previous HDMI project:

Since the default output of ZYNQ's PS using the EMIO method is GMII, and our network part (adapter card) chip RTL8211 outputs RGMII, we need to add a GMII to RGMII conversion IP module (Gmii to Rgmii).

image-20250623175025060

Open the GMII TO RGMII module and change the settings as shown below.

image-20250623175103147

image-20250623175132990

Also, because GMII TO RGMII is active-high reset, but ZYNQ outputs an active-low reset, we need to add an inverter (search for utility, and in the retrieved options, select utility vector logic).

image-20250623175153058

In the settings page, change it to not (inverter) and set the bit width to 1.

image-20250623175211671

Since the configuration requirements for the network port conflict with the HDMI configuration requirements, we need to modify the ZYNQ settings:

image-20250707170016275

image-20250626122914744

Connect according to the diagram below:

image-20250626123241385

After modifying the block design, save it, then regenerate "Generate Output Products" and "Create HDL Wrapper". Next, we need to modify the constraints file to assign pins for the Ethernet1 interface according to the schematic.

image-20250623170246796

image-20250623170455309

image-20250623171033261

image-20250623171052724

Save the constraints file, then proceed with the subsequent operations to regenerate the BIT file.

Create Vitis Project

Since it can share the same project with Ethernet0, there is no need to create a new project. However, some modifications are still needed:

In the project's code files, change the network port to Ethernet1:

image-20250707165510132

image-20250707165534246

Modify the lwip library files:

Modify the lwip211.mld file:

According to the software installation path, mine is at C:\Xilinx\Vitis\2021.1\data\embeddedsw\ThirdParty\sw_services\lwip211_v1_5\data. Add the following content:

After that, open the BSP and modify the settings as shown in the figure below:

image-20250707170551773

Modify the lwip211.tcl file (file path: C:\Xilinx\Vitis\2021.1\data\embeddedsw\ThirdParty\sw_services\lwip211_v1_5\data), and add the following content:

Similarly, after making the modifications, be sure to right-click the platform project and select Build Project:

image-20250707172615917

 

Compile and Debug

After the project is compiled successfully, connect the development board's JTAG to the computer using a Type-C USB cable, and use another Type-C USB cable to connect the board's PS UART to the computer. Connect an Ethernet cable between the board and the computer. Open a serial debugging tool like MobaXterm on the computer and establish a connection with the development board's PS UART. Through the serial port, you can observe that the network has started, the IP address is 192.168.3.150, and the network port is port 7.

image-20250707172124246

Using a Windows computer on the same router network segment (you can use the host's IP), ping this IP address. If the ping is successful, it means the network connection is established:

image-20250813190855569

After connecting with a network debugging assistant, whatever data you send will be received back through the network (the port number is set to 7, and the IP address is set according to the board's IP address read from the serial port earlier). Run a TCP client on the computer:

image-20250908152435669